// import request from '@/utils/request'

// const permissionApi = {
//   queryAuthedPermission: '/api/auth/permission/routes',
//   queryPermissions: '/api/auth/permission/permissions'
// }

class Service {
  /**
   * @description POST 查询授权菜单权限
   */
  static postAuthPermission(data: any) {
    console.log(data)

    // data = {roleName: '超级管理员'}
    return new Promise((resolve) => {
      resolve({
        status: 0,
        data: {
          authedRoutes: [
            '/dashboard',
            '/guide',
            '/dragable',
            '/calendar',
            '/copy',
            '/zip',
            '/role',
            '/menu',
            '/projectboard',
            '/excel',
            '/table',
            '/form',
            '/qrcode',
            '/editor',
            '/upload',
            '/cropper',
            '/personal',
            '/interview'
          ]
        },
        success: true,
        message: '成功'
      })
    })

    // return request({
    //   url: permissionApi.queryAuthedPermission,
    //   method: 'POST',
    //   json: true,
    //   data
    // }).then((res) => {
    //   if (res.status === 0) {
    //     return Promise.resolve(res)
    //   }
    //   return Promise.reject(res)
    // })
  }

  /**
   * @description POST 查询授权菜单权限
   */
  static postPermissions(data: any) {
    console.log(data)
    return new Promise((resolve) => {
      resolve({
        status: 0,
        data: {
          permissions: ['test:permission-btn', 'test:permission-btn2', 'test:permission-btn3']
        },
        success: true,
        message: '成功'
      })
    })
    // return request({
    //   url: permissionApi.queryPermissions,
    //   method: 'POST',
    //   json: true,
    //   data
    // }).then((res) => {
    //   console.log(res);

    //   if (res.status === 0) {
    //     return Promise.resolve(res)
    //   }
    //   return Promise.reject(res)
    // })
  }
}
export default Service
